<!DOCTYPE html>
<html lang="zh-cn">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <link rel="stylesheet" href="../1.3/components/MySwitch.css">
</head>
<body>
    <div id="app">
        <p>flag:{{flag}}</p>
        <input type="checkbox" v-model="flag"><br>
        <my-switch @updata:flag="updataFlag" :flag="flag"></my-switch>
        
    </div>
    <script type="module">
        import { createApp } from "../assets/vue3/vue.esm-browser.js";
        import MySwitch from "../1.3/components/MySwitch.js";
        createApp({
            data() {
                return {
                    flag:true
                }
            },
            components:{
                MySwitch
            },
            methods:{
               updataFlag(e){
                this.flag=e
               } 
            }
        }).mount("#app");
    </script>
</body>
</html>